package com.hsp.homework.homework13;

public class Teacher extends Person{
    private int work_age;
    private String hobbit;

    public Teacher(String name, String sex, int age,int work_age,String hobbit) {
        super(name, sex, age);
        this.work_age = work_age;
        this.hobbit = hobbit;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    public String getHobbit() {
        return hobbit;
    }

    public void setHobbit(String hobbit) {
        this.hobbit = hobbit;
    }

    public String  teach(){
       return  "我承诺，我会认真教学";
    }
    @Override
    public String play() {
        return super.play()+hobbit;
    }

    @Override
    public String toString() {
        return "老师的信息:"+"\n"+
                "姓名："+getName()+"\n"+
                "年龄："+getAge()+"\n"+
                "性别:"+getSex()+"\n"+
                "工龄：" + work_age+"\n"+
                ""+teach()+"\n"+
                play()
                ;
    }
    public void printInfo(){
        System.out.println("老师的信息：");
        System.out.println(super.basicInfo());
        System.out.println("工龄："+work_age);
        teach();
        System.out.println(play());;
    }
}
